package top.hjcwzx.wrench.design.framework.service.tree.node;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import top.hjcwzx.wrench.design.framework.model.tree.TreeReq;
import top.hjcwzx.wrench.design.framework.model.tree.TreeRes;
import top.hjcwzx.wrench.design.framework.service.tree.AbstractTestSupport;
import top.hjcwzx.wrench.design.framework.service.tree.factory.DefaultTreeTestFactory;
import top.hjcwzx.wrench.design.framework.tree.StrategyHandler;


@Slf4j
@Service
public class ErrorNode extends AbstractTestSupport<TreeReq, DefaultTreeTestFactory.DynamicContext, TreeRes> {
    @Override
    public TreeRes apply(TreeReq requestParameter, DefaultTreeTestFactory.DynamicContext dynamicContext) throws Exception {
        TreeRes res = TreeRes.builder().result(false).resultStr("节点错误").build();
        log.info("抽象规则决策树-错误节点-返回错误值:{}", res);
        return res;
    }

    @Override
    public StrategyHandler<TreeReq, DefaultTreeTestFactory.DynamicContext, TreeRes> get(TreeReq requestParameter, DefaultTreeTestFactory.DynamicContext dynamicContext) throws Exception {
        log.info("抽象规则决策树-错误节点流转-无下一节点");
        return null;
    }
}
